Skip to content

Improve readability of CLI trace output#5104

Open
sahanaxzy wants to merge 16 commits intoboa-dev:mainfrom
sahanaxzy:fix-trace-output-readability
Open

Improve readability of CLI trace output#5104
sahanaxzy wants to merge 16 commits intoboa-dev:mainfrom
sahanaxzy:fix-trace-output-readability

Conversation

@sahanaxzy
Copy link
Contributor

Description

The trace output in the CLI was difficult to read when the stack grew large — table rows would overflow the terminal width, making everything look messy.

solves #5102

Changes

Group consecutive identical values: Repeated stack entries like undefined, undefined, undefined are now displayed as undefined (x3), reducing visual noise

Truncate long values: Individual stack values are capped at 18 characters to prevent single entries from blowing out the table layout

Cap total stack display width: The stack column is bounded so lines don't overflow the terminal, with a .. (N total) indicator showing the full stack depth

Empty stack handling: Empty stacks now display [ <empty> ] instead of [ ]

@sahanaxzy sahanaxzy requested a review from a team as a code owner March 15, 2026 20:01
@github-actions github-actions bot added the Waiting On Review Waiting on reviews from the maintainers label Mar 15, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Mar 15, 2026
@github-actions github-actions bot added C-Builtins PRs and Issues related to builtins/intrinsics C-VM Issues and PRs related to the Boa Virtual Machine. labels Mar 15, 2026
@github-actions
Copy link

github-actions bot commented Mar 15, 2026

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 50,073 50,073 0
Ignored 2,072 2,072 0
Failed 818 818 0
Panics 0 0 0
Conformance 94.54% 94.54% 0.00%

Tested main commit: daf86d30277a5c1fb353825347f75c1d83516905
Tested PR commit: 69fd0d726d5972249cab0fe5545b741d912271a7
Compare commits: daf86d3...69fd0d7

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 0% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.26%. Comparing base (6ddc2b4) to head (69fd0d7).
⚠️ Report is 884 commits behind head on main.

Files with missing lines Patch % Lines
core/engine/src/vm/mod.rs 0.00% 53 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #5104       +/-   ##
===========================================
+ Coverage   47.24%   59.26%   +12.02%     
===========================================
  Files         476      580      +104     
  Lines       46892    63190    +16298     
===========================================
+ Hits        22154    37450    +15296     
- Misses      24738    25740     +1002     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jedel1043
Copy link
Member

One suggestion that I always wanted to do was to display undefined -> und, function -> func, object -> obj, etc. The logic for this is that folks that are tracing through bytecode usually already know the internals of JS engines, so offering a more brief representation of all values would make it easier to show more state about the VM at once

@sahanaxzy
Copy link
Contributor Author

Thanks for the suggestion... I have updated
the stack output is lot more prettier now

Copy link
Contributor

@Monti-27 Monti-27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of bugs stood out in the new stack formatter.

@sahanaxzy sahanaxzy requested a review from Monti-27 March 16, 2026 14:33
@sahanaxzy sahanaxzy requested a review from Monti-27 March 17, 2026 20:33

let separator = if let Some(fc) = marker {
format!(" |{fc}|")
} else if i + 1 < total && !(force_truncate && i + 1 == groups.len()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small thing here: this is still using total stack entries for the comma decision, so grouped output can end up with a trailing comma like [ und (x2), ]. i think this should key off rendered groups here instead.

@sahanaxzy sahanaxzy requested a review from Monti-27 March 18, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Builtins PRs and Issues related to builtins/intrinsics C-VM Issues and PRs related to the Boa Virtual Machine. Waiting On Review Waiting on reviews from the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants